#pragma once
#include "2D/Window.h"
#include "Runtime/Platform/GenericApplication.h"

namespace Alice
{
    class SlaveRenderer;
    enum class ESlateTickType : uint8
    {
        /** Tick time only */
        Time = 1 << 0,

        /** Only process input for the platform, and additional input tasks by Slate. */
        PlatformAndInput = 1 << 1,

        /** Only Tick and Paint Widgets */
        Widgets = 1 << 2,

        /** Time and Widgets */
        TimeAndWidgets = Time | Widgets,

        /** Update time, tick and paint widgets, and process input */
        All = Time | PlatformAndInput | Widgets,
    };

    ENUM_CLASS_FLAGS(ESlateTickType);
    class Application
    {
    public:
        static GenericApplication* mPlatformApplication;
        static Application* mCurrentApplication;
        SlaveRenderer* mSlaveRenderer;
        static void Create();
        static Application* Get()
        {
            return mCurrentApplication;
        }
        virtual Window* AddWindow(Window* InSlateWindow, const bool bShowImmediately = true );
        GenericWindow* MakeWindow(Window* InSlateWindow, const bool bShowImmediately);
        void Tick(ESlateTickType inTickType=ESlateTickType::All);
        void TickPlatform(float DeltaTime);
        virtual bool InitializeRenderer(SlaveRenderer* inRenderer, bool bQuietMode = false );
    };
}
